;
var member_set_opt = {
    init:function () {
        this.eventBind();
    },
    eventBind:function () {
        $(".wrap_member_set .save").click(function(){
            var btn_target = $(this);
            if(btn_target.hasClass( "disabled" )){
                common_ops.alert("正在处理中，请不要重复点击~~");
                return;
            }


            var nickname_target = $(".wrap_member_set input[name=nickname]");
            var nickname = nickname_target.val();

            var mobile_target = $(".wrap_member_set input[name=mobile]");
            var mobile = mobile_target.val();

            var id_target = $(".wrap_member_set input[name=id]");
            var id = id_target.val();

            if( nickname.length < 1 ){
                common_ops.tip( "请输入合法的用户名",nickname_target );
                return ;
            }

            if( mobile.length < 1 ){
                common_ops.tip( "请输入合法的手机号",mobile_target );
                return ;
            }

            btn_target.addClass( "disabled" );

            var data = {
                nickname:nickname,
                mobile:mobile,
                id:id
            }

            $.ajax({
                url:common_ops.buildWebUrl( "/member/set" ),
                type:"POST",
                data:data,
                dataType:"json",
                success:function( res ){
                    btn_target.removeClass( "disabled" );
                    var callback = null;
                    if( res.code == 200 ){
                        callback = function(){
                            window.location.href = common_ops.buildWebUrl( "/member/index" );
                        }
                        common_ops.alert( "设置成功！",callback );
                    }
                }
            });
        });
    }
}

$(document).ready(function () {
    member_set_opt.init();
});